package com.practice.system.controller;

import com.practice.system.pojo.User;
import com.practice.system.service.UserService;
import com.practice.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public R login(@RequestBody User user) {
        return userService.login(user);
    }

    @RequestMapping("/sign")
    public R sign(@RequestBody User user) {
        return userService.sign(user);
    }
}
